<script type="text/javascript">
//全局变量
var GV = {
    ROOT: "__ROOT__/",
    WEB_ROOT: "__WEB_ROOT__/",
    JS_ROOT: "static/js/"
};
</script>
<!-- Le javascript
    ================================================== -->
    <!-- Placed at the end of the document so the pages load faster -->
    <script src="__TMPL__/public/assets/js/jquery-1.10.2.min.js"></script>
    <script src="__TMPL__/public/assets/js/jquery-migrate-1.2.1.js"></script>
    <script src="__STATIC__/js/wind.js"></script>
    <script src="__TMPL__/public/assets/simpleboot3/bootstrap/js/bootstrap.min.js"></script>
    <script src="__STATIC__/js/frontend.js"></script>

    <script src="__TMPL__/public/html_assets/js/slide.js"></script>
    <script src="__TMPL__/public/html_assets/js/swiper.min.js"></script>
    <script src="__TMPL__/public/html_assets/js/pop.js"></script>
    <script src="__STATIC__/js/layer/layer.js"></script>



<script>
	$(function(){
		$("#main-menu li.dropdown").hover(function(){
			$(this).addClass("open");
		},function(){
			$(this).removeClass("open");
		});
		
		$("#main-menu a").each(function() {
			if ($(this)[0].href == String(window.location)) {
				$(this).parentsUntil("#main-menu>ul>li").addClass("active");
			}
		});
		
		$.post("{:url('user/index/isLogin')}",{},function(data){
		    console.log(data);
			if(data.code==1){
				if(data.data.user.avatar){
				}

				$("#main-menu-user span.user-nickname").text(data.data.user.user_nickname?data.data.user.user_nickname:data.data.user.user_login);
				$("#main-menu-user li.login").show();
                $("#main-menu-user li.offline").hide();

			}

			if(data.code==0){
                $("#main-menu-user li.login").hide();
				$("#main-menu-user li.offline").show();
			}

		});

        ;(function($){
			$.fn.totop=function(opt){
				var scrolling=false;
				return this.each(function(){
					var $this=$(this);
					$(window).scroll(function(){
						if(!scrolling){
							var sd=$(window).scrollTop();
							if(sd>100){
								$this.fadeIn();
							}else{
								$this.fadeOut();
							}
						}
					});
//


					$this.click(function(){
						scrolling=true;
						$('html, body').animate({
							scrollTop : 0
						}, 500,function(){
							scrolling=false;
							$this.fadeOut();
						});
					});
				});
			};
		})(jQuery); 
		
		$("#backtotop").totop();
		
		
	});

	//jiaxiaotongnav边栏选择孩子
    $(function () {
        $('#select_child').click(function () {
            $('.hoverul').toggle(300);

            $('.hovera').click(function () {
                var $id=$(this).attr('data');
                $.ajax({
                    data:{'student_id':$id},
                    url:"{:url('jiaxiaotong/common/ajax_student')}",
                    success:function(data){
                        console.log(data);

                        location.reload();
                    },
                    error:function(){
                        console.log('error');
                    }
                });
            })
        })
    })
	$("#continu_content").mouseover(function(e)
	{

		var tooltip="<div id='tooltip'>"+this.title+"</div>";
		$("body").append(tooltip);
		$("#tooltip").css({
//			'top': (e.pageY)+'px',
//			'left': (e.pageX)+'px',
			'position':'absolute',
//			'width':100,
//			'height':20,
//			'background':'blue',
//			'z-index':2000,
		}).show('fast');

	}).mouseout(function()
	{
		$("#tooltip").remove();
	})
	</script>

